package 异常;

public class Test {
    int  age;
    public   void   show(int age){
        if (age>18){
            System.out.println("欢迎光临");
        }else{
            try {
                throw   new ageExpection("未成年人禁止入内");
            }catch (ageExpection e){
                System.out.println(e.getMessage());
                System.out.println(e.getStackTrace());
            }
        }
    }

    public static void main(String[] args) {
        Test test = new Test();
        test.show(17);

    }
}
